Skip to content

Jetpack: validate site verification codes - #52091

Open
haqadn wants to merge 4 commits into
trunkfrom
fix/dsgcom-534-validate-site-verification-codes
Open

Jetpack: validate site verification codes#52091
haqadn wants to merge 4 commits into
trunkfrom
fix/dsgcom-534-validate-site-verification-codes

Conversation

@haqadn

@haqadn haqadn commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Fixes DSGCOM-534

Proposed changes

  • Validate site verification codes against the character sets accepted by Google, Bing, Pinterest, Yandex, and Facebook.
  • Continue accepting a full verification meta tag by extracting its content value before validation.
  • Return an HTTP 400 response from the site settings endpoint when a supplied code is invalid, so clients do not report a successful save.
  • Add utility and endpoint coverage for accepted codes, rejected codes, and meta-tag extraction.

Related product discussion/links

  • DSGCOM-534

Does this pull request change what data or activity we track or use?

No.

Testing instructions

  • Run jetpack docker phpunit jetpack -- --filter='Jetpack_Verification_Tools_Utils_Test|WPCOM_JSON_API_Site_Settings_V1_4_Endpoint_Test'.
  • Confirm all 65 tests pass.
  • POST a valid Bing verification token, or its full meta tag, through the sites/%s/settings endpoint and confirm the token is saved.
  • POST a Bing value containing non-hex characters and confirm the endpoint returns HTTP 400 without saving it.

@haqadn haqadn added Bug When a feature is broken and / or not performing as intended [Status] Needs Review This PR is ready for review. labels Sep 8, 2026
@haqadn haqadn self-assigned this Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.

  • To test on WoA, go to the Plugins menu on a WoA dev site. Click on the "Upload" button and follow the upgrade flow to be able to upload, install, and activate the Jetpack Beta plugin. Once the plugin is active, go to Jetpack > Jetpack Beta, select your plugin (Jetpack), and enable the fix/dsgcom-534-validate-site-verification-codes branch.
  • To test on Simple, run the following command on your sandbox:
bin/jetpack-downloader test jetpack fix/dsgcom-534-validate-site-verification-codes

Interested in more tips and information?

  • In your local development environment, use the jetpack rsync command to sync your changes to a WoA dev blog.
  • Read more about our development workflow here: PCYsg-eg0-p2
  • Figure out when your changes will be shipped to customers here: PCYsg-eg5-p2

@github-actions github-actions Bot added [Feature] Verification tools [Feature] WPCOM API [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Tests] Includes Tests labels Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Thank you for your PR!

When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:

  • ✅ Include a description of your PR changes.
  • ✅ Add a "[Status]" label (In Progress, Needs Review, ...).
  • ✅ Add testing instructions.
  • ✅ Specify whether this PR includes any changes to data or privacy.
  • ✅ Add changelog entries to affected projects

This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖


Follow this PR Review Process:

  1. Ensure all required checks appearing at the bottom of this PR are passing.
  2. Make sure to test your changes on all platforms that it applies to. You're responsible for the quality of the code you ship.
  3. You can use GitHub's Reviewers functionality to request a review.
  4. When it's reviewed and merged, you will be pinged in Slack to deploy the changes to WordPress.com simple once the build is done.

If you have questions about anything, reach out in #jetpack-developers for guidance!


Jetpack plugin:

The Jetpack plugin has different release cadences depending on the platform:

  • WordPress.com Simple releases happen as soon as you deploy your changes after merging this PR (PCYsg-Jjm-p2).
  • WoA releases happen weekly.
  • Releases to self-hosted sites happen monthly:
    • Scheduled release: October 6, 2026

If you have any questions about the release process, please ask in the #jetpack-releases channel on Slack.

@jp-launch-control

jp-launch-control Bot commented Sep 8, 2026

Copy link
Copy Markdown

Code Coverage Summary

Coverage changed in 2 files.

File Coverage Δ% Δ Uncovered
projects/plugins/jetpack/json-endpoints/class.wpcom-json-api-site-settings-endpoint.php 450/911 (49.40%) 0.89% -3 💚
projects/plugins/jetpack/modules/verification-tools/verification-tools-utils.php 16/19 (84.21%) 30.88% -4 💚

Full summary · PHP report · JS report

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug When a feature is broken and / or not performing as intended [Feature] Verification tools [Feature] WPCOM API [Plugin] Jetpack Issues about the Jetpack plugin. https://wordpress.org/plugins/jetpack/ [Status] Needs Review This PR is ready for review. [Tests] Includes Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant